Repository navigation
fix(studio): a sealed resize of a scaled layer keeps its corner on the pointer at rest - #8562
Merged
Merged
Conversation
… an unsealed one measures
…at fractional sizes
…e pointer at rest
…-scale # Conflicts: # packages/studio/src/components/editor/resizeDraft.test.ts # packages/studio/src/components/editor/resizeDraft.ts
Contributor
Edit accuracy: accurate 271 (base branch 271), smooth 86 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
terencecho
approved these changes
Nov 23, 2026
terencecho
left a comment
Contributor
There was a problem hiding this comment.
The reconstructed sealed corners now use the measured layer scale and edit zoom on each axis. That matches how the gesture derives the layer scale and leaves the zoom-only case intact. The PR description names the regression row that fails without the fix. All 33 focused tests passed locally, and GitHub checks passed or were skipped.
— tai (automated review)
This was referenced Nov 23, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
In a sealed preview, resizing a layer that has its own scale now leaves the dragged corner on the pointer when you stop, as an unsealed preview does. Before, it rested up to about a quarter of a pixel off.
Why
#8560 builds the sealed box's corners from the gesture to work out the rounding remainder, but it sized them with Studio's zoom alone. A layer drawn with a GSAP scale is that much bigger on screen, so the remainder came out short by the layer's own scale. On a 1.5x layer the sealed draft rested 0.18 to 0.21 px off the pointer, against 0.01 unsealed. The release path doesn't change that: both modes add the same 0.04 to 0.05 px after release and save the same corrected position.
Related work
Follows #8560, which added the sealed remainder.
How
packages/studio/src/components/editor/resizeDraft.ts: the gesture's corners use the zoom times the layer's own scale (contentScaleX/Y, which the gesture already measures and which is 1 for an unscaled layer), the same size the overlay box is drawn at.Test plan
fails without the fix:
packages/studio/src/components/editor/resizeDraft.test.ts, "moves a sealed box by the same rounding remainder an unsealed draft measures", the row for a box drawn 1.5x mostly by its own 3x scale. Without the fix the sealed shift is 0.25 px off the one the unsealed draft measures; with it, within 0.07 px. The row drawn 1.5x by zoom alone passes either way.With the fix, on a Linux machine:
resizeDraft.test.ts,domEditResizeLocal.test.tsandanchoredResizeReleaseShift.test.tspass three runs in a row (33 tests). The push gate's named and covering files, Studiotsc, Fallow and pre-push are clean.Bench
Edit-accuracy bench on a Linux machine, the 13 scale resize cases, main at 4f5bfc2 (with #8560) with and without this change, the same bench for both, two runs per mode, the same in both runs. In px:
-aftercases at rest after releaseStill different sealed: the
-aftercases rest 0.11 to 0.20 px from the pointer against 0.05 unsealed. One sealed run with this change also showed the one-frame jump after release onresize-scale-px-r0-root-z100-on, which this change doesn't touch.No visible change
Sealed previews are off by default, so nothing changes for anyone yet.